import Vue from 'vue'
import Router from 'vue-router'
import inc from './inc'
import acc from './acc'

Vue.use(Router)

/* Layout */
import Layout from '@/layout'

export const constantRoutes = [
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path*',
        component: () => import('@/views/redirect/index')
      }
    ]
  },
  {
    path: '/loginPage',
    component: () => import('@/views/login/index'),
    name: 'loginPage',
    hidden: true
  },

  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },

  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    meta: { title: '首页', titleEn: 'Dashboard', icon: 'fa-home' },
    children: [
      {
        path: 'dashboard',
        name: 'Dashboard',
        component: () => import('@/views/lph/index'),
        meta: {
          title: '首页',
          titleEn: 'Dashboard',
          icon: 'fa-home',
          affix: true
        }
      }
    ]
  }
]
const asyncRoute = []
export const asyncRoutes = asyncRoute.concat(inc, acc)

export default new Router({
  base: 'boh',
  mode: 'history', // 后端支持可开
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})
